﻿<UserControl x:Class="DefinitionViewer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             d:DesignHeight="300"
             d:DesignWidth="300"
             mc:Ignorable="d">
    <Border HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch"
            BorderBrush="Gray"
            BorderThickness="1"
            SnapsToDevicePixels="True">
        <ScrollViewer>
            <StackPanel Margin="2">
                <TextBlock TextWrapping="Wrap">
                    <Run FontWeight="Bold">
                        <MultiBinding StringFormat="{}{0}: ">
                            <Binding Path="Name" />
                        </MultiBinding>
                    </Run>
                    <Run Text="{Binding Path=Description}"></Run>
                </TextBlock>
                <TextBlock>
                    <TextBlock.Text>
                        <MultiBinding StringFormat="Arguments: {0}">
                            <Binding Path="ArgumentsAsString" />
                        </MultiBinding>
                    </TextBlock.Text>
                </TextBlock>
                <ItemsControl ItemsSource="{Binding Path=Arguments}" BorderThickness="0">
                    <ItemsControl.ItemTemplate>
                        <ItemContainerTemplate>
                            <TextBlock Margin="20,0,0,0" TextWrapping="Wrap">
                                <Run FontWeight="Bold">
                                    <Binding StringFormat="{}{0}: " Path="Name" />
                                </Run>
                                <Run FontStyle="Italic">
                                    <Binding StringFormat="{}{0}: " Path="Type" />
                                </Run>
                                <Run Text="{Binding Path=Description}"/>
                            </TextBlock>
                        </ItemContainerTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </StackPanel>
        </ScrollViewer>

    </Border>
</UserControl>
